package com.ruoyi.system.api.domain.basedata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 商品对象 finer_goods
 *
 * @author wl
 * @date 2024-10-25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Goods implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    private Integer id;

    /**
     * 商品编号
     */
    @Excel(name = "商品编号")
    private String proCode;

    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    private String proName;

    /**
     * 商品单位
     */
    private Integer unitId;

    /**
     * 商品单位名称
     */
    @Excel(name = "商品单位")
    private String unitName;

    /**
     * 商品成本
     */
    @Excel(name = "商品成本(元)")
    private BigDecimal cost;

    /**
     * 商品销售底价
     */
    @Excel(name = "商品销售底价(元)")
    private BigDecimal price;

    /**
     * 商品类别
     */
    private Integer typeId;

    /**
     * 商品类别名称
     */
    @Excel(name = "商品类别")
    private String typeName;

    /**
     * 商品备注
     */
    @Excel(name = "商品备注")
    private String proRemark;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createDate;

    /**
     * 修改人
     */
    @Excel(name = "修改人")
    private String modifyBy;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date modifyDate;

    /**
     * 是否删除(0:未删除   1:删除)
     */
    private Integer isDel;

    /**
     * 分类ids
     */
    private List<Integer> typeIds;

    /**
     * 搜索值
     */
    @JsonIgnore
    private String searchValue;

    /**
     * 请求参数
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;

    public Map<String, Object> getParams() {
        if (params == null) {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }
}
